#
# @lc app=leetcode.cn id=14 lang=python3
#
# [14] 最长公共前缀
#
# @lc code=start
class Solution:
    def longestCommonPrefix(self, strs):
        n = len(strs)
        if n == 0: return ""
        min_len = 2147483647
        for str in strs:
            min_len = min(min_len, len(str))
        for i in range(min_len):
            for j in range(n):
                if strs[0][i] != strs[j][i]:
                    return strs[0][:i]
        return strs[0][:min_len]
                
# @lc code=end

